<html>
<head>
	<title></title>
</head>
<body>
<h4>const</h4>
<?php 
// const
// 常量前面没有美元符号$
// 常量只能用 define()函数定义
// 常量可以不用理会变量范围的规则,可以在任何地方定义和访问。
// 常量的值只能是标量,即整型、浮点型、字符串 3 种类型。
// 常量一旦定义, 就不能被重新定义或者取消定义,值不能发生改变
	define("NAME", "wu-zhong-qin");
	echo NAME;
?>
<br/>

<?php
	echo NAME;	echo "<br/>";
	echo __FILE__;	echo "<br/>";
	echo __LINE__;	echo "<br/>";
	echo PHP_VERSION;	echo "<br/>";
	echo PHP_OS;	echo "<br/>";
	echo TRUE;	echo "<br/>";
	echo FALSE;	echo "<br/>";
	echo E_ERROR;	echo "<br/>";
	echo E_WARNING;	echo "<br/>";
	echo E_PARSE;	echo "<br/>";
	echo E_NOTICE;	echo "<br/>";
?>

<h4>variable</h4>
<?php 
	$foo=1;
	$bar="abc";
	$fb="3abc";

	settype($fb, "integer"); // 3abc -> 3
	echo "<br/>";
	echo $fb;

	settype($bar, "integer"); // "abc" ->0
	echo "<br/>";
	echo $bar;
?>
<br>
<?php 
	echo $_SERVER[PHP_SELF]; echo "<br/>";
	echo $_SERVER[REQUEST_METHOD]; echo "<br/>";
	echo $_SERVER[DOCUMENT_ROOT]; echo "<br/>";
	echo $_SERVER[HTTP_REFERER]; echo "<br/>";
	echo $_SERVER[REMOTE_ADDR]; echo "<br/>";
	echo $_COOKIE; echo "<br/>";
	echo $_SESSION; echo "<br/>";
	echo $GLOBALS; echo "<br/>";
	echo $_SERVER[HTTP_REFERER];echo "<br/>";
?>

<br/>
<a href="/array.php">next : array in php</a>
</body>
</html>
